<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>H+ 后台主题UI框架 - 基础表格</title>
<meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
<meta name="description"
	content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

<jsp:include page="/_layout/_css.jsp" />
<link href="${ctx}/css/plugins/iCheck/custom.css" rel="stylesheet">
<style type="text/css">
	.col-sm-1{
		padding-right: 0px;
		margin-top: 7px;
		padding-left: 0px;
	}
	.col-sm-3{
	padding-left: 0px;
	}
	.input-sm form-control input-s-sm inline{
		padding-top:0px;
		padding-bottom: 0px;
	}
	.form-control, .single-line {
		padding-top:0px;
		padding-bottom: 0px;
	}
</style>
<script type="text/javascript">
	var op = document.getElementById("select").options;
	for (var i=0; i<op.length; i++) {
	    if (option[i].value=="${value}") option[i].selected = true;
	}

	//条件查询
	function f1(){
		var  myselect=document.getElementById("select");
		var index=myselect.selectedIndex ;
		var select=myselect.options[index].value;
		location.href="${ctx}/servlet/BookServlet?page=1&pageNum=1&typeid="+select;
	}
	
</script>
</head>

<body class="gray-bg">
	<div class="ibox float-e-margins">
		<div class="ibox-content">
                    <div class="row">
                    	<div class="col-sm-1" style="">请选择图书类别：</div>
                        <div class="col-sm-3">
                            <div class="input-group">
                           
                            <select class="input-sm form-control input-s-sm inline" name="type" id="select">
                            	<option value="0" <c:if test="${value==0}">selected</c:if>></option>
                            	<c:forEach items="${type_list}" var="type">
                                <option value="${type.typeid}" <c:if test="${value==type.typeid}">selected</c:if> >${type.typename}</option>
                            	</c:forEach>
                            </select>
                            <span class="input-group-btn">
                                        <button type="button" class="btn btn-sm btn-primary" onclick="f1()">查询</button> </span>
                            </div>
                        </div>
                        <div class="col-sm-4"></div>
                        <div class="col-sm-3">
                            <div class="input-group">
                                <input type="text" placeholder="请输入关键词" class="input-sm form-control">
                                <span class="input-group-btn">
                                        <button type="button" class="btn btn-sm btn-primary"> 搜索</button> </span>
                            </div>
                        </div>
                    </div>
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
								<th>书名</th>
                                <th>作者</th>
                                <th>出版社</th>
                                <th>出版时间</th>
                                <th>描述</th>
                                <th>数量</th>
                                <th>价格</th>
                                <th>销售量</th>
                                <th>管理</th>
                            </tr>
                            </thead>
                            <tbody>
                            	<c:forEach	items="${book_list}" var="book">
                            		<tr>
                            			<td>${book.bookname}</td>
                            			<td>${book.author}</td>
                            			<td>${book.press}</td>
                            			<td>${book.pubtime}</td>
                            			<td>${book.dis}</td>
                            			<td>${book.bookcount}</td>
                            			<td>${book.price}</td>
                            			<td>${book.salenum}</td>
                            			<td>
                            				<a href="table_basic.html#"><i class="fa fa-check text-navy"></i></a>
                            				&nbsp;&nbsp;&nbsp;<a href="table_basic.html#"><i class="fa fa-close text-danger"></i></a>
                            			
                            			</td>
		                            </tr>
                            		
                            	</c:forEach>
                            </tbody>
                        </table>
                        <div id="split"></div>
                    </div>

                </div>
            </div>
	<jsp:include page="/_layout/_script.jsp" />
	<!-- Peity -->
	<script src="${ctx}/js/plugins/peity/jquery.peity.min.js"></script>

	<!-- iCheck -->
	<script src="${ctx}/js/plugins/iCheck/icheck.min.js"></script>

	<!-- Peity -->
	<script src="${ctx}/js/demo/peity-demo.js"></script>

	<script type="text/javascript"
		src="${ctx}/js/plugins/jquery-bootstrap-paginatiion/jquery-bootstrap-pagination.js"></script>

	<script>
//         $(document).ready(function () {
//             $('.i-checks').iCheck({
//                 checkboxClass: 'icheckbox_square-green',
//                 radioClass: 'iradio_square-green',
//             });
//         });
        
        
//         function deleteThis(id,obj){
//         	 if(confirm("是否删除此项？")){
//         		$.get('${ctx}/EmpServlet/remove',{'id':id},function(data){
//         			if(data){
//         				layer.msg("删除成功");
//         				$(obj).parents('tr').remove();
//         			}
//         		});
//         	} 
//         }
			
        
			var  myselect=document.getElementById("select");
			var index=myselect.selectedIndex ;
			var select=myselect.options[index].value;
        //分页:
        	$("#split").pagination({
				  total_pages: ${pageCount},
				  current_page: ${pageNum},
				  next: "下一页",
				  prev: "上一页",
				  display_max: 4,
				  ignore_single_page: false,
				  callback: function(event, page) {
					  location = "${ctx}/servlet/BookServlet?page=1&typeid="+select+"&pageNum="+page;
				  }
			});
			
    </script>

	<!--统计代码，可删除-->

</body>

</html>
